<template>
	<view class="detailBox">
		<view class="detailItem" v-for="item in newsDetail" :key='item.id'>
			<view class="title">{{item.title}}</view>
			<view class="flex MTB">
				<text class="time">发表时间：{{$dateFormat(item.add_time)}}</text>
				<text class="preView">预览：{{item.click}}</text>
			</view>
			<rich-text :nodes="item.content"></rich-text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 资讯详情数据
				newsDetail:[]
			}
		},
		methods: {
			
		},
		async onLoad({id}) {
			const {data} = await this.$myRequest({
				url:`/api/getnew/${id}`
			});
			this.newsDetail = [...data.message];
		}
	}
</script>

<style lang="scss" scoped>
	page {
		color: #fff;
		padding: $padding;
		background-color: $themeColor;
	}

	.title {
		text-align: center;
	}

	.detailBox .flex {
		justify-content: space-between;
	}
</style>
